---
title: Data Fetching
excerpt: A powerful client to fetch JSON:API resources from Drupal.
weight: 0.1
---

```tsx
// Fetch an article.
const article = await drupal.getResource(
  "node--article",
  "907034d4-ab35-4949-84e4-d2b7afed82df"
)
```

```ts
// Fetch a collection of terms.
const tags = await drupal.getResourceCollection("taxonomy_term--tags")
```

```ts
// Fetch a menu.
const main = await drupal.getMenu("main")
```

```ts
// Fetch a view.
const recentContent = await drupal.getView("content_recent--block")
```

```ts
// Use filters.
const sortedPublishArticles = await drupal.getResourceCollection(
  "node--article",
  {
    params: {
      "filter[status]": "1",
      sorted: "-created",
    },
  }
)
```
